package solved;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

/*
ID:		liluyan1
LANG:	JAVA
TASK:	fracdec
*/
public class fracdec {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new FileReader("fracdec.in"));
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
				"fracdec.out")));
		new fracdec().solve(f, out);
		out.close();
		System.exit(0);
	}
	
	private int count = 0;
	
	private void solve(BufferedReader f, PrintWriter out) throws IOException {
		int[] a = read(f, 2);
		int N = a[0];
		int D = a[1];
		
		print(out, N/D + ".");
		N = N%D;
		
		ArrayList<Integer> r = new ArrayList<Integer>();
		ArrayList<Integer> o = new ArrayList<Integer>();
		r.add(N);
		
		boolean[] present = new boolean[D];
		present[N] = true;
		
		boolean found = false;
		int start = 0;
		do {
			if (N == 0) {
				for (int j : o) print(out, "" + j);
				print(out, o.size()==0? "0\n" : "\n");
				break;
			}
			
			N = N*10;
			o.add(N/D);
			
			N = N%D;
			if (present[N]) {
				found = true;
				for (int i=0; i<r.size(); i++) {
					if (r.get(i) == N) {
						start = i;
					}
				}
				
				for (int j=0; j<o.size(); j++) {
					if (j == start) print(out, "(");
					print(out, "" + o.get(j));
				}
				print(out, ")\n");
			}
			else {
				r.add(N);
				present[N] = true; 
			}
		} while (!found);
	}
	
	private void print(PrintWriter out, String s) {
		out.print(s);
		count += s.length();
		if (count >= 76) {
			out.println();
			count = 0;
		}
	}
	
	public int read(BufferedReader f) throws IOException {
		return Integer.parseInt(f.readLine());
	}
	
	public int[] read(BufferedReader f, int N) throws IOException {
		String[] t = f.readLine().split(" ");
		int[] a = new int[N];
		for (int i=0; i<N; i++) {
			a[i] = Integer.parseInt(t[i]);
		}
		return a;
	}
}
